<template>
  <div>
    <!--查询-->
    <el-form :inline="true"  class="demo-form-inline">
      <el-form-item label="讲师名称">
        <el-input v-model="pagess.tname" placeholder="讲师名称"></el-input>
      </el-form-item>
        <span class="demonstration">活动时间</span>
      <el-date-picker
        v-model="pagess.createtime"
        type="daterange"
        align="right"
        unlink-panels
        range-separator="至"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        value-format="yyyy-MM-dd"
        >
      </el-date-picker>
      <el-form-item>
        <el-button type="primary" @click="se()">查询</el-button>
        <el-button @click="cz()">重置</el-button>
      </el-form-item>
    </el-form>



    <el-table
      :data="tableData"
      style="width: 100%"
   >
      <el-table-column
        prop="tid"
        label="序号"
        width="180">
      </el-table-column>
      <el-table-column
        prop="t_name"
        label="讲师名称">
      </el-table-column>
      <el-table-column
        prop="t_phone"
        label="手机号"
        width="180">
        <template labl="tphone" slot-scope="scope">
          <el-button type="text" @click="phonecha(scope.row.tid)">{{scope.row.t_phone}}</el-button>
        </template>
      </el-table-column>
      <el-table-column
        prop="t_bankcard"
        label="银行卡号">
      </el-table-column>
      <el-table-column
        prop="t_name"
        label="开户名">
      </el-table-column>
      <el-table-column
        prop="teacherzsr"
        label="讲师收入">
      </el-table-column>
      <el-table-column
        prop="pingtaizsr"
        label="平台收入">
      </el-table-column>
      <el-table-column
        prop="status2"
        label="审核状态">
        <template slot-scope="scope">
          <span v-if="scope.row.status2 == 0">待审核</span>
          <span v-if="scope.row.status2 == 1">通过</span>
          <span v-if="scope.row.status2 == 2">未通过</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="t_createtime"
        label="时间">
      </el-table-column>
    </el-table>
    <!--分页-->
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="pagess.currentPage"
      :page-sizes="[2,4,6,8]"
      :page-size="pagess.pagesize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="pagess.total">
    </el-pagination>
  </div>
</template>
<style>

</style>
<script>
  import qs from  'qs'
  export default {
    methods: {
      handleSizeChange(val) {
        this.pagess.pagesize=val;
        this.query()
      },
      handleCurrentChange(val) {
        this.pagess.currentPage=val;
        this.query()
      },
      //重置按钮
      cz(){
        this.pagess.tname=""
        this.pagess.createtime=""
      },
      //模糊查询按钮
      se(){
        this.pagess.currentPage=1
        this.query()
      },
      //查询
      query(){
        this.$axios.post("http://localhost:8061/list/share/selefr",qs.stringify(this.pagess)).then(r=>{
          this.tableData=r.data.obj;
        })
        this.$axios.get("http://localhost:8061/list/share/setotal").then(r=>{
          this.pagess.total=r.data.obj;
        })
      },
    },
    created(){
      this.query();
    },
    data() {
      return {
        tableData: [{

        }],
        pagess: {
          currentPage:1,//当前页
          pagesize:2,//每页显示条数
          total:0,//数据的总条数
          tname: "",
          createtime:"",
        },
       /* pickerOptions: {
          shortcuts: [{
            text: '最近一周',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit('pick', [start, end]);
            }
          }, {
            text: '最近一个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit('pick', [start, end]);
            }
          }, {
            text: '最近三个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit('pick', [start, end]);
            }
          }]
        },*/

        /*时间*/
      }
    },


  }
</script>
